<script setup lang="ts">
import type { EaTask } from './type'

const baseApi = '/ea/ea-task'

const { loadData, loading, model } = useDetail<EaTask>(baseApi)

defineExpose({ init: loadData })
</script>

<template>
  <el-empty v-if="!Object.keys(model).length" v-loading="loading" />
  <el-descriptions v-else v-loading="loading" :column="2" border>
    <el-descriptions-item label="客户id" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.memberIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="工作人数" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.peopleNum }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="经度" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.longitude }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="纬度" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.latitude }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="地址" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workAddress }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="收费模式" label-class-name="item-label" label-align="right">
      <el-tag v-if="model.taskFeeTypeLabel" :color="model.taskFeeTypeLabel.ext?.color" effect="dark" type="info">
        {{ model.taskFeeTypeLabel?.label }}
      </el-tag>
    </el-descriptions-item>
    <el-descriptions-item label="工时" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workHour }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="费用" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.price }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="支付金额" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.payMoney }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="工作要求" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workDemand }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="发布任务图片" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.taskPic }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="工种" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workTypeIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="地区编号" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.areaCode }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="区域id" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.orgIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="任务状态" label-class-name="item-label" label-align="right">
      <el-tag v-if="model.taskStatusLabel" :color="model.taskStatusLabel.ext?.color" effect="dark" type="info">
        {{ model.taskStatusLabel?.label }}
      </el-tag>
    </el-descriptions-item>
    <el-descriptions-item label="完成时间" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.completeTime }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="是否支付" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.isPay }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="优惠券用户ID" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.discountCouponUserIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="详细地址" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.detailAddress }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="预约时间" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.appointmentTime }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="其他工种名称" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workTypeName }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="发布任务视频" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.taskVideo }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="支付方式" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.payType }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="订单编号" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.orderNo }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="是否指派单" label-class-name="item-label" label-align="right">
      <template v-if="model.isAssign != null">
        {{ model.isAssign ? '是' : '否' }}
      </template>
    </el-descriptions-item>
    <el-descriptions-item label="指派工人Id" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.assignWorkerId }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="总价" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.totalPrice }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="是否开票" label-class-name="item-label" label-align="right">
      <template v-if="model.isInvoice != null">
        {{ model.isInvoice ? '是' : '否' }}
      </template>
    </el-descriptions-item>
    <el-descriptions-item label="加价" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.raisePrice }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="单人总价" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.singlePrice }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="城市编号" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.cityCode }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="创建人" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.createByLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="创建时间" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.createTime }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="更新人" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.updateByLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="更新时间" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.updateTime }}
      </span>
    </el-descriptions-item>
  </el-descriptions>
</template>

<style scoped lang="scss">
.el-descriptions {
  :deep(.el-descriptions__header) {
    margin: 0 10px 12px;
  }

  :deep(.item-label) {
    width: 120px;
  }
}
</style>
